package com.itheima.exer.homework.hw1009;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class NamePass2 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要保存的用户名:");
        String userName = sc.nextLine();
        System.out.println("请输入要保存的密码:");
        String passWord = sc.nextLine();
        BufferedWriter bw = new BufferedWriter(new FileWriter(new File("c.txt")));
        bw.write("用户名:"+userName+"\r\n"+"密码:"+passWord+"\r\n");
        bw.close();
    }
}
